﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Snake
{
    class GameController
    {
        private String PressedKey { get; set; }

        public ConsoleKeyInfo? GetConsoleKey()
        {                
            if(Console.KeyAvailable)
            {
                ConsoleKeyInfo keyInfo = Console.ReadKey(true);
                return Console.ReadKey(true);
            }
            return null;            
        }

        public string GetPressedKey(ConsoleKeyInfo? getValue)
        {
            //string s = "left";
            if (getValue.HasValue)
            {
                ConsoleKeyInfo info = getValue.Value;

                return info.Key.ToString();
            }
            else
            {
                return null/*s*/;
            }
        }


    }
}
